package com.sxj.corejava.code09_集合.Set集合;

import java.util.HashSet;
import java.util.Set;

/**
 * @author 石小俊
 * @date 2024年04月28日 11:05
 */
public class Test04_判断元素是否重复 {

    public static void main(String[] args) {
        Set<Student> set = new HashSet<>();
        Student student = new Student(1, "admin");
        Student student2 = new Student(1, "admin");
        set.add(student);
        set.add(student2);
        System.out.println(student.hashCode());
        System.out.println(student2.hashCode());
        System.out.println(student.equals(student2));
        System.out.println(set);
    }

}
